Comments

Comments In CSS#

everyone likes to know what is the benefits of doing something, so let us know what is the benefits from comments in CSS

Why do we use CSS comments?#

  • to remove the complexity from the source code (source code is the written code).
  • To guide the writer or the reader to the used ideas.
  • To explain why the writer have used this technique over the others.
  • To disable some lines of code.
  • to debuging the source code (debugging in simple words is to check and resolve the bugs in source code).

any commented code will not be compiled and will not affect the html document like /* color: green; */ will not make the text green because the line is commented

so now we know why we need comments now let us know how to make comments in CSS.

comments in CSS

commented code not working

first file

Result

first file

The steps to add comments in CSS#

  • add forward slash followed by astricks /*
  • write your comments.
  • and at the end add astricks followed with forward slash */.

Your turn to add comments#

  • open index.css file.
  • try to find a place to add comments.